<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title>商家登录</title>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<link rel="stylesheet" charset="utf-8" href="css/login.css">
	</head>

	<body style="background: url(assets/img/bg/7.png);">
		<div class="login_header">
			<div class="header_center clearfix">
				<div class="myfl">
					<span>欢迎登陆</span>
				</div>
				<div class="myfr">
					<a href="index.html">返回主页</a><span></span>
					<a href="javascript:;">收藏网站</a><span></span>
					<a href="login.html">用户登陆</a>
				</div>
			</div>
		</div>
		<div class="login_content clearfix" style="position: absolute; text-align: center;left: -150px;">
			<form action="" method="post">
				<input type="hidden" name="memberType" id="parameter" value="1" />
				<div class="login_box myfr">
					<p class="tabchange clearfix">
						<span class="myfl sign_select" id="usertype">商家登录</span>
					</p>
					<p class="system_error"></p>
					<input type="text" name="nick" value="" placeholder="手机号/用户名" id="username" />
					<p class="username_error"><span>用户名不能为空!</span></p>
					<input type="password" placeholder="登录密码" id="password" name="password" maxlength="16" value="" style="background: url(assets/img/bg/11.jpg);"/>
					<p class="password_error"><span>密码不能为空!</span></p>
					<p class="forget_password clearfix">
						<a href="" class="myfr">忘记密码？</a>
					</p>
		
					<a href="merchantShop.html">	
						<input class="submit_btn" style="text-align: center;" value="立即登陆">
					</a>
					
					<p class="entry_mode clearfix">
						<span class="myfl">你可以免费注册:</span>
						<a href="register.html" class="myfr">
							<em></em>
							<i>快速注册</i>
						</a>
					</p>
				</div>
			</form>
		</div>
	</body>
	<script type="text/javascript" src="js/jquery-1.11.1.min.js"></script>
	<script type="text/javascript">
		(function() {
			'use strict';
			var name_regular = /^[0-9a-zA-Z-_ \u4e00-\u9fa5]*$/, //昵称的正则表达式。
				password_regular = /^(?!(?:\d*$))[A-Za-z0-9]{6,16}$/, //密码的正则表达式。
				UserName = $("#username"), //用户名输入框
				Password = $("#password"), //密码输入框
				SubmitBtn = $(".submit_btn"), //获取form表单的提交按钮
				Parameter = $("#parameter"); //传给后台的type

			//验证用户名
			UserName.on("blur", function() {
				if(name_regular.test(UserName.val()) && UserName.val().length > 3 && UserName.val().length < 21) {
					UserName.next().children("span").css("display", "none")
				} else if(UserName.val().length < 1) {
					UserName.next().children("span").css("display", "inline-block");
					UserName.next().children("span").text("用户名不能为空！");
					SyserrDom.text("");
				} else if(name_regular.test(UserName.val()) == false) {
					UserName.next().children("span").css("display", "inline-block");
					UserName.next().children("span").text("用户名格式不正确！");
					SyserrDom.text("");
				} else {
					UserName.next().children("span").css("display", "inline-block");
					UserName.next().children("span").text("用户名格式不正确！");
					SyserrDom.text("");
				}
			});
			//验证密码
			Password.blur(function() {
				if(Password.val().length < 1 || password_regular.test(Password.val()) == false) {
					if(Password.val().length < 1) {
						Password.next().children("span").text("密码不能为空！");
						$(".SyserrDom").text("");
					} else {
						Password.next().children("span").text("密码格式不正确！");
						$(".SyserrDom").text("");
					}
					Password.next().children("span").css("display", "block");
				} else {
					Password.next().children("span").css("display", "none")
				}
			});

		}());
	</script>
	
</html>